﻿/// <reference path="gameObjectFactory.js" />
/// <reference path="jquery-2.0.2.js" />
var nextFigField = {
    render: function () {
        $figField = $("<div id='fig_field'></div>").appendTo("div#board");
        $figField.css({
            'background-color': '#fff', 'width': '120px', 'height': '110px',
            'border': '1px solid black', 'top': '18px', 'left': '240px', 'position': 'absolute',
            'border-radius': '10px'
        });
    }
};
var nextFig = gameObjectFactory.extend({
    // Shape colors
    colors: [CellColors[1], CellColors[1], CellColors[1], CellColors[1], CellColors[1], CellColors[1], CellColors[1], CellColors[1]],
    render: function () {
        $nextFig = $("<div id='next_symbol'></div>").appendTo("div#fig_field");
        $nextFig.css({
            'position': 'absolute', 'left': '260px', 'top': '60px'
        });
        var nextFigure = this.getFigure();
        engine.render(nextFigure._coords, 0, 0, 0, nextFigure.color, $nextFig);
    },

    getFigure: function () {
        var nextFigure = gameObjectFactory.getRandomFigure();
        return nextFigure;
    }
});
var controls = {
    init: function () {
        $controlsInfo = $("<div id='info'></div>").appendTo("div#board");
        $controlsInfo.html('<div>Rotate:&nbsp;&uarr;</div><div>Move left:&nbsp;&larr;</div><div>Move right:&nbsp;&rarr;</div>');
        $controlsInfo.css({
            'font-family': 'Segoe UI', 'font-size': '16px',
            'top': '150px', 'left': '252px', 'position': 'absolute',
            'color': 'white'
        });
    },
};
var statistics = {
    init: function () {
        $stats = $("<div id='stats'></div>").appendTo("div#board");
        $scoreRes = $("<div id ='score'>Score: " + score + "</div>").appendTo("div#stats");

        $scoreRes.css({
            'font-family': 'Segoe UI', 'font-size': '20px', 'width': '7em',
            'top': '250px', 'left': '250px', 'position': 'absolute',
            'color': 'white', 'font-weight': 'bold'
        });
    }
};
